from django.db import models

from users.models import User


class Money(models.Model):
    """投资收益模型"""
    year = models.CharField(max_length=20, verbose_name='年份')
    year_c_money = models.CharField(max_length=20, verbose_name='年初资金')
    year_z_add = models.CharField(max_length=20, default=0, verbose_name='年中追加资金')
    year_z_out = models.CharField(max_length=20, default=0, verbose_name='年中取出资金')
    dn_year_add = models.CharField(max_length=20, default=0, verbose_name='当年追加本金')
    dn_year_money = models.CharField(max_length=20, default=0, verbose_name='当年本金')
    year_m_money = models.CharField(max_length=20, default=0, verbose_name='年末资金')
    dn_year_profit = models.CharField(max_length=20, verbose_name='当年盈利')
    all_money = models.CharField(max_length=20, verbose_name='总本金')
    all_profit = models.CharField(max_length=20, verbose_name='总盈利')
    users_id = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True, verbose_name="用户id")


    class Meta:
        db_table = 'tb_money'
        verbose_name = '投资收益表'
        verbose_name_plural = verbose_name